<link href="<@sp.static/>/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<link href="<@sp.static/>/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link href="<@sp.static/>/assets/css/style.min.css" rel="stylesheet"/>
<link href="<@sp.static/>/assets/plugins/datatables/css/data-table.css" rel="stylesheet"/>
<div style="overflow: auto; height: 450px; position: relative; margin: 8px;">
    <div class="panel panel-inverse pop-panel" data-sortable-id="form-stuff-5">
        <div class="panel-body">
            <form id="storeForm" name="storeForm" method="post" class="form-inline">
                    <input style="width:160px;" type="text" placeholder="店铺ID" class="form-control" name="EQ_id">
                    <input style="width:200px;" type="text" placeholder="店铺名称" class="form-control" name="LIKE_name">
                    <button type="button" class="btn btn-success btn-sm"
                            onclick="postDataByForm('${rc.contextPath}/backend/coupon/quickSearchStore', 'qstoreList', 'storeForm');"><i class="fa fa-search"></i>查询
                    </button>
            </form>
        </div>
    </div>
    <div class="pop-list" id="qstoreList"></div>
    <div class="pop-footer">
        <button type="button" id="selectedButton" class="btn btn-sm btn-success m-5">确定</button>
    </div>
</div>

<!-- jquery -->
<script src="<@sp.static/>/js/jquery/jquery-3.0.0.min.js" type="text/javascript" charset="UTF-8"></script>
<!-- jquery validate -->
<script src="<@sp.static/>/js/jquery/validation/jquery.validate.min.js" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="<@sp.static/>/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="<@sp.static/>/js/layer/layer.js?v=1.7.9" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/custom/util.js?v=1.7.9" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/custom/message.js?v=1.7.9" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/custom/send.js?v=1.7.9" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript" language="JavaScript">
    $(function () {
        postDataByForm('${rc.contextPath}/backend/coupon/quickSearchStore?v='+Math.random(), 'qstoreList', 'storeForm');
    });

    $(function () {
        $('#selectedButton').click(function () {
            parent.$('#storeName').empty();
            var stores = '';
            $("input:checkbox[name='id']:checked").each(function (index, elem) {
                //如果父页面已存在，则跳出执行下一条
                var storeName = $(elem).parent().parent().find("input[name='storeNameTD']").val();
                var storeId = $(elem).parent().parent().find("input[name='storeIdTD']").val();
                var showName = "<span class='label label-info f-s-14 m-t-5' style='display: inline-block;margin-right:5px;'>"+storeName+"</span>"
                parent.$('#storeName').append(showName);
                if (stores.length > 0) {
                    stores = stores + ',' + storeId;
                } else {
                    stores = storeId;
                }
            });

            var store = '<input id="storeIds" name="storeIds" type="hidden" value="'+stores+'">';
            parent.$('#storeName').append(store);

            parent.layer.closeAll();
        });
    });
</script>